package com.cyq.day04;

import java.util.Scanner;

public class ClassWork06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //判断一个数是否为质数
        System.out.println("请输入一个数");
        int i;
        int num = sc.nextInt();
        for (i = 2; i < num; i++) {
            if (num % i == 0) {
                break;
            }
        }
        if (i == num ) {
            System.out.println(num + "是质数");
        } else {
            System.out.println(num + "不是质数");
        }

    }
}
